home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / fmt.lbr / FMT.DOC < prev    next >
Encoding:
Text File  |  2011-02-04  |  4.8 KB  |  127 lines

  1.         =====EASY DISK FORMATTING=====
  2.        =====Including EASY EXIT and DISK SPACE CHECK=====
  3.  
  4.        When you have a lot of disks to format, or if you
  5.        just want to pre-format a whole box in a hurry, or
  6.        if you want to make it easy for your secretary to do it,
  7.        try this (you must be using DOS 2):
  8.  
  9. 1. Copy the following files to your RAMDISK:
  10.    (You can write a batch file to do this, to make it easier).
  11.  
  12.     FORMAT.COM
  13.     FMT.BAT
  14.     INPUT
  15.     CHK.COM
  16.  
  17. 2. Make the drive that you copied these to the default, put 2 floppies to
  18.    be formatted in drives A and B, and type
  19.         FMT
  20.  
  21. 3. As each drive finishes, replace that disk with a new one.
  22.    When done, press the Backspace key (you will then exit to DOS as
  23.    soon as the present disk is completed).  Any key will work, but
  24.    keys that print on the screen will show that key on the DOS command
  25.    line when the batch file is done, which can be inconvenient.
  26.    If, after formatting, a disk has any bad sectors, FMT will return you
  27.    to DOS and print a "B" on the screen.  You can then shake the disk,
  28.    blow on it, whatever, and try it again - just type FMT when ready.
  29.  
  30. -----------------------------------------------------------------
  31. -----------------------------------------------------------------
  32.    How to make up the files:
  33.    [To avoid typing these in again, just extract them with
  34.     your text editor].
  35. -----------------------------------------------------------------
  36.  
  37.     FMT.BAT:
  38.  
  39. ECHO OFF
  40. CLS
  41. ECHO FORMATTING DRIVE B:...
  42. FORMAT B: <INPUT >NUL
  43. CHK B
  44. IF ERRORLEVEL 1 GOTO EXIT
  45. CLS
  46. ECHO Formatting drive A:...
  47. FORMAT A: <INPUT >NUL
  48. CHK A
  49. IF ERRORLEVEL 1 GOTO EXIT
  50. fmt
  51. :EXIT
  52. ------------------------------------
  53.  
  54.     INPUT:
  55.  
  56. <Carriage return>
  57. N
  58. ------------------------------------
  59.     CHK.COM:
  60.  
  61.     First make up the ascii file BRK as follows:
  62.     (the space just before RCX is a carriage return - important)
  63.  
  64. A100
  65. MOV     SI,0082                            
  66. MOV     DL,[SI]                            
  67. OR      DL,20                              
  68. SUB     DL,60                              
  69. MOV     AH,36                              
  70. INT     21                                 
  71. MUL     BX                                 
  72. CMP     AX,02C4                            
  73. MOV     AX,0E42                            
  74. JNZ     0121                               
  75. MOV     AH,0B                              
  76. INT     21                                 
  77. MOV     AH,4C                              
  78. INT     21                                 
  79. INT     10                                 
  80. JMP     011D                               
  81.  
  82. RCX
  83. 80
  84. W
  85. Q
  86.  
  87.     The Q is the last item in BRK...
  88.     Now type DEBUG CHK.COM <BRK
  89.  
  90.     When you return to DOS you will discover that there is now a
  91.      new file called CHK.COM on your disk.
  92. ---------------------------------------------------------------------
  93.  
  94.            Credits and Other Interesting Stuff   --Jan. 1, 1985--
  95.  
  96. Original FMT.BAT is from Stephen Goodman's BBS file and ESP Software,
  97. and was published as a letter in The Programmer's Journal, Vol. 2, #6.
  98. CHK.COM and ERRORLEVEL check by Jack Wright, CIS 74176,3256.
  99. Thanks to Jim Gainsley for suggesting the disk space check.
  100.  
  101. Due to Ctrl-Break disabling by FORMAT, Ctrl-Break would not allow you to
  102. exit from the original batch file, unless you held it down continuously at
  103. the end of the formatting.  And if you did this, you would stop the FORMAT
  104. program just as it was about to put the FAT, boot record, and Directory on
  105. the disk.  If you've ever wondered what the DOS message "File creation error" 
  106. meant, that was the cause - DOS was trying to find the directory and FAT on
  107. a disk that didn't have them.
  108. The addition of CHK and the ERRORLEVEL check allows you to exit by
  109. pressing any key at any time (though it will not have an effect until
  110. the present disk has completed formatting).  CHK also checks to see
  111. if there were any bad sectors on the formatted disk, and prints a "B"
  112. (for Bad) and exits to DOS if there were, allowing you to weed out the
  113. bad disks, check them for dirt, etc., and try them again.  CHK requires
  114. one argument - the drive letter of the drive to be checked.  No colon needed.
  115.  
  116. If you are formatting disks differently than the standard 9 sector,
  117. 2-sided format, you will need to change the 02C4 value in the
  118. CMP statement in CHK.COM above to reflect the free space in the
  119. format you're using.  It should equal the no. of sectors of free
  120. space in hex.
  121.  
  122. Remember that the FORMAT command can be dangerous.  That's why formatting
  123. was not originally designed to be this easy.  Keep your fingers
  124. away from the "C" key when typing in the FMT format line, and be careful
  125. what you feed the PC when FMT is running.  You might want to delete
  126. FMT.BAT from your RAMDISK when you are done, in case you are prone to
  127. typing things in by accident.  Don't la